//
//  WmcTextTagView.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/19.
//

import UIKit

class WmcHookEdgeTextTagView: WmcBaseTagView {

    lazy var hookEdgeLabel: WmcHookEdgeLabel = {
        let label = WmcHookEdgeLabel()
        return label
    }()

    override func makeUI() {
        super.makeUI()
        tagStyle = .textHookEdge
        defaultSize = CGSize(width: 255, height: 110)
        
        hookEdgeLabel.text = textLabel.text
        hookEdgeLabel.font = textLabel.font
        hookEdgeLabel.textAlignment = textLabel.textAlignment
        hookEdgeLabel.numberOfLines = textLabel.numberOfLines
        // 狸猫换太子
        textLabel = hookEdgeLabel
        
        contentView.addSubview(hookEdgeLabel)
        hookEdgeLabel.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
    }
    
    override func changeColor(_ color: WmcBaseTagView.Colors) {
        let uicolor = color.info.hexStr.yp.uiColor
        hookEdgeLabel.textColor = uicolor
        if color == .white {
            hookEdgeLabel.borderColor = .black
        }else{
            hookEdgeLabel.borderColor = .white
        }
    }
}
